Don't use IN_FLOAT() when calling fabs() since it may clobber errno.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 17 Jul 2012 02:56:00 +0000 (19:56 -0700)
committerRob Browning <rlb@defaultvalue.org>
Sat, 8 Sep 2012 22:22:12 +0000 (17:22 -0500)
The emacs build shouldn't fail sometimes with an "Arithmetic error:".

Previously Emacs assumed that fabs() would not modify errno
unless there was an error, but that isn't guaranteed since fabs()
has no error conditions.

Origin: upstream, commit: 8e0e7a92f5ae99ce2461fc0f0b606d4cec3efb81
Added-by: Rob Browning <rlb@defaultvalue.org>
Provided-By: Paul Eggert <eggert@cs.ucla.edu>
Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11913

src/ChangeLog
src/floatfns.c

index 45d9cea63539ada73b671a2791615047c402c58c..a0fa9403a391cd33449a96f6dabb3048e119ddf9 100644 (file)
        (Fdelete_other_windows_internal): Signal an error if the window is
        on a dead frame (Bug#11984).
 
+2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
+       Unlike the other wrapped functions, fabs has an unspecified
+       effect on errno.
+
 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
 
        Remove FILE_SYSTEM_CASE.
index 305c78cae63b4bd7892d20604873698cc25a2cb8..fa672c7643118675d64c52974593cb2480645236 100644 (file)
@@ -676,7 +676,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
   CHECK_NUMBER_OR_FLOAT (arg);
 
   if (FLOATP (arg))
-    IN_FLOAT (arg = make_float (fabs (XFLOAT_DATA (arg))), "abs", arg);
+    arg = make_float (fabs (XFLOAT_DATA (arg)));
   else if (XINT (arg) < 0)
     XSETINT (arg, - XINT (arg));